This invention relates to reducing blurring associated with objects forming part of a grey scale image represented by an array of pixels. The invention is particularly useful for, but not necessarily limited to, reducing blurring of a stored image that was obtained by a camera, wherein the image includes one or more out of focus objects.
Images, often called pictures, are often obtained by devices such as a camera or video. When an image is being obtained, for example by a camera, focussing is restricted to objects that are of a similar distance from the camera""s lens and other objects in different distance will be out of focus and blurred. For instance, often when a picture is obtained, it is desirable, that both foreground and background objects are clearly represented. Unfortunately, if the foreground and background objects are spaced far apart relative to a camera lens, blurring of either foreground or background objects will occur.
Cameras have been developed to obtain pictures that reduced blurring of out of focus objects at the expense of degrading clarity of in focus objects. Therefore, the blurring may still occur thereby affecting picture quality.
It is an aim of the invention to overcome or alleviate at least one of the problems associated with reducing blurring associated with objects forming part of a grey scale image represented by an array of pixels.
According to one aspect of the invention there is provided a method for reducing blurring associated with objects forming part of a grey scale image, the method comprising the steps of:
receiving a set of image pixels;
calculating a gradient value for each one of said image pixels in said set, said gradient value being indicative of one or more edges of an object in said grey scale image;
selecting candidate object edge pixels from said image pixels in said set, said selecting being effected by comparing said gradient value for each one of said image pixels in said set with a threshold value;
determining a distribution of number candidate object edge pixels with specific grey level values; and
non-linearly modifying one or more said grey level values of said candidate object edge pixels, wherein candidate object edge pixels within said distribution that have the same grey level values are identically non-linearly modified.
Preferably, said selecting determines candidate object edge pixels when said gradient value for each one of said image pixels in said set is larger than said threshold value.
Preferably, said selecting determines candidate object edge pixels when said gradient value for each one of said image pixels in said set is at least equal to said threshold value.
Suitably, said step of non-linearly modifying includes:
identifying extremities of said distribution and leaving said grey level values of said candidate object edge pixels at said extremities unchanged. Suitably, no more than 10% of a lower distribution extremity will be unchanged. In a similar suitable manner, no more than 10% of an upper distribution extremity will be unchanged.
Preferably, said step of non-linearly modifying further includes:
modifying said grey level values of said candidate object edge pixels between extremities of said distribution and half a standard deviation of said distribution by an amount dependent upon the grey level value of the candidate object edge pixels and said standard deviation.
Preferably, said step of Non-linearly modifying further includes:
modifying grey level values of said candidate object edge pixels between half a standard deviation and a mean of said distribution by an amount dependent upon said mean of said distribution.
Suitably, said step of determining a distribution is effected on a subset of said candidate object edge pixels.
Preferably, said step of determining a distribution is effected by a localised histogram generator operating on a small set of said candidate object edge pixels from a localised area of the image.
Suitably, the method is performed by a digital camera.